package ysq.xyg.sys.model.po;

import lombok.Data;
import lombok.NoArgsConstructor;
import ysq.xyg.base.util.BaseConstant;
import ysq.xyg.base.util.BaseUtil;

import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.Table;
import java.io.Serializable;
import java.util.Date;

/**
 * 系统部分-字典码内容
 *
 * @author shengQiang yu
 * @date 2018-03-18 15:41
 */
@Data
@NoArgsConstructor
@Table(name = "xyg_sys_dict_content")
public class SysDictContent implements Serializable {
    /**
     * 主键
     */
    @Id
    private String id;

    /**
     * 字典键值
     */
    @Column(name = "value")
    private String value;

    /**
     * 字典标签
     */
    @Column(name = "name")
    private String name;
    /**
     * 字典项类型
     */
    @Column(name = "dict_type")
    private String dictType;

    /**
     * 排序
     */
    private int sort;

    /**
     * 有效状态:1、有效，2、无效
     */
    @Column(name = "status")
    private String status;

    /**
     * 删除标识：1、正常，2、已删除
     */
    @Column(name = "remove_tag")
    private String removeTag;

    /**
     * 创建时间
     */
    @Column(name = "create_time")
    private Date createTime;
    /**
     * 创建人
     */
    @Column(name = "create_user")
    private String createUser;

    /**
     * 修改时间
     */
    @Column(name = "update_time")
    private Date updateTime;
    /**
     * 修改人
     */
    @Column(name = "update_user")
    private String updateUser;

    public SysDictContent(SysUser sysUser) {
        this.id= BaseUtil.uId();
        this.removeTag= BaseConstant.BASE_REMOVE_TAG_NORMAL;
        this.createTime = new Date();
        this.createUser = sysUser.getId();
        this.updateTime = new Date();
        this.updateUser = sysUser.getId();
    }
}